/**
 * 分路由文件，主程序
 */
const tt = require('../routerManage');
const express = require('express');
var router = express.Router();

// const scanResult = tt.scanDirModules(__dirname, __filename);

// for (const prefix in scanResult) {
//   if (scanResult.hasOwnProperty(prefix)) {
//     router.use(prefix, scanResult[prefix])
//   }
// }
const routeModules = tt.scanDirModules(__dirname, __filename);
routeModules.forEach(routeModule => {
  router.use(routeModule)
})

module.exports = router;
